<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="{TPL}css/NewTopFoot.css" rel="Stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="{TPL}css/AddItemPanel.css">
<link type="text/css" id="styleName" rel="stylesheet" href="{TPL}css/blue/color.css"/ >
<link type="text/css" rel="stylesheet" href="{TPL}css/ShoppingRecords.css">
<link type="text/css" rel="stylesheet" href="{TPL}css/jquery.datepick.css"> 
<script type="text/javascript" src="{TPL}js/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="{TPL}js/jQuery.Extend.js"></script>
<script src="{TPL}js/jQuery.Drag.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{TPL}js/jquery.cookies.2.1.0.min.js"></script>
<script src="{TPL}js/Gobal.js" type="text/javascript"> </script>
<script type="text/javascript" src="{TPL}js/wdggcGobal.js"></script>
<script src="images/js/calendar/js/jscal2.js"  language="javascript" charset="utf-8"></script>
<script src="images/js/calendar/js/lang/cn.js" language="javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="images/js/calendar/css/jscal2.css" />
    <style type="text/css">
.pages {float:right;height:25px;margin:15px 0 0 0;display:inline;}
.pages li{list-style-type: none;}
.pages  a{text-decoration:none;}
.pages li{
border:1px solid #AAAAAA;color:#666666;display:inline;float:left;height:20px;margin-left:2px;text-decoration:none;}
.pages li {border:1px solid #DDDDDD;color:#CCC;font-family:"simsun";}
.pages li:hover {background:#FFEDE1;border:1px solid #FF9900;}
.pages .current {background:#FFEDE1;border:1px solid #FF6600;color:#FF0000;}
.pages em {color:#999999;display:inline;float:left;height:22px;line-height:22px;margin-left:5px;}
    </style><title>
</title></head><body>
    <form id="aspnetForm" action="ShoppingRecords.aspx?t=1" method="post" name="aspnetForm">
<div>
<input type="hidden" value="/wEPDwUKMjA0NzMxMzk0M2Rk" id="__VIEWSTATE" name="__VIEWSTATE">
</div>
{template 'header'}
   <div class="admin">
        <div class="ding">
            <div class="shouye">
                <a href="{url_m.php}" title="{lang u_member_center}"></a>
            </div>
            <div class="lb">
               <div class="weizhi">
                      <b>{lang m_location}：</b><a href="{url_m.php}">{lang u_member_center}</a><span>&gt;</span>{lang m_space_num} - <?php echo $area; ?>
                  </div>
                <div class="shezhi">
                    <p>
                        <a href="{url_m.php}">{lang u_member_center}</a><span>|</span>{lang m_set_style}：</p>
                    <ul>
                        <li onClick="changeStyle('orange')" class="mypanliS1"></li>
                        <li onClick="changeStyle('grey')" class="mypanliS2"></li>
                        <li onClick="changeStyle('blue')" class="mypanliS3"></li>
                    </ul>
                </div>
            </div>
        </div>
 {template 'member_left'}
    <div class="records">
      <div class="biao tui">
          <table>
                <tbody><tr>
                    <th class="w1" style="width:15%">
                        {lang m_area}                    </th>
                    <th class="w2" style="width:20%;text-align:center">
                        {lang m_space}                 </th>
                    <th class="w3" style="width:40%">
                        {lang m_using}                     </th>
                    <th class="w4" style="width:25%">
                        {lang m_left_weight}                   </th>
                </tr>
            </tbody></table>
             <table width="100%" border="0" cellspacing="1" cellpadding="0">
				<?php $icount = 0; while($datamaster = mysql_fetch_array($datamastersql)){ ?>
					<?php 
						$typeshow ="KG";
						$findme = '海运';
						$pos = strpos($datamaster['master_name'], $findme);
						if ($pos == true)
						{
							$typeshow = "{lang m_unit_price}";
						}
						
						
						if($icount == 0){ 
					?>
				   <tr>
					 <td width="15%" rowspan="<?php echo $datamastercount ?>"><?php echo $dataarea['area_name'] ?></td>
					 <td width="20%"><?php echo $datamaster['master_name'] ?></td>
					 <td width="40%"><?php echo $datamaster['ms_desc'] ?></td>
					 <td width="25%"><a href="cangwei.php?cat=<?php echo $datamaster['master_name'] ?>&area=<?php echo $dataarea['area_name'] ?>"><b>
					 <?php $accoutkg = 0;  
					 $accountsql=mysql_query("select If(sum(kg)>0,sum(kg),0) as accountkg,buytype,buyarea,msid 
								from dg_cangwei_trans where uname = '".$uname."' and msid = '".$datamaster['msid']."' group by msid");
					 $accountdetail = mysql_fetch_array($accountsql);
					 $accountnum = mysql_num_rows($accountsql);
					 
					 if($accountnum > 0)
					 {
						$accoutkg = $accountdetail['accountkg'];
						
					 }
					 echo number_format($accoutkg,2,".",",").$typeshow;
					 ?></b><img width="35px" height="35px" src='images/buyimg.jpg'/></a></td>
				   </tr>
				<?php }else{?> 
				   <tr>
					 <td width="20%"><?php echo $datamaster['master_name'] ?></td>
					 <td width="40%"><?php echo $datamaster['type_desc'] ?></td>
					 <td width="25%"><a href="cangwei.php?cat=<?php echo $datamaster['master_name'] ?>&area=<?php echo $dataarea['area_name'] ?>"><b>
					 <?php $accoutkg2 = 0; $typeshow2 ="KG";
					 $accountsql2=mysql_query("select If(sum(kg)>0,sum(kg),0) as accountkg,buytype,buyarea,msid 
								from dg_cangwei_trans where uname = '".$uname."' and msid = '".$datamaster['msid']."' group by msid");
					 $accountdetail2 = mysql_fetch_array($accountsql2);
					 $accountnum2 = mysql_num_rows($accountsql2);
					
					 if($accountnum2 > 0)
					 {
						$accoutkg2 = $accountdetail2['accountkg'];
						
					 }
					 echo number_format($accoutkg2,2,".",",").$typeshow;
					 
					 ?> </b><img width="35px" height="35px" src='images/buyimg.jpg'/></a></td>
				   </tr>
				 <?php }$icount++; ?>
			   <?php } ?>
             </table>
      <div class="">
	  {echo pagelist($total,$pagesize,$page,"");}
      </div>
      </div>
    </div>
    <script type="text/javascript">
      var cal = Calendar.setup({
          onSelect: function(cal) { cal.hide() },
          showTime: true
      });
      cal.manageFields("startDatebtn", "startDate", "%Y-%m-%d");
	  cal.manageFields("endDatebtn", "endDate", "%Y-%m-%d");
        function search() {
            var url = "m.php?name=recordslist&type=" + $(".jilu .on").attr("index");
            if ($("#startDate").val().length > 0)
                url += ("&s=" + encodeURI($("#startDate").val()));
            if ($("#endDate").val().length > 0)
                url += ("&e=" + encodeURI($("#endDate").val()));
            window.location = url;
        }
    </script>
        <div class="yj">
        </div>
    </div>
{template 'footer'}
    </form>
</body>
</html>